package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.WithdrawDao;
import com.platform.server.service.WithdrawService;
import com.platform.server.util.StringTools;

@Service
public class WithdrawServiceImpl implements WithdrawService {

	@Autowired
	private WithdrawDao withdrawDao;
	
	/**
	 * 提现审核列表
	 */
	@Override
	public List<Map<String, Object>> selectWithdrawList(String id,String state,String startTime,String endTime,String mobile,String address,String type) {
		Map<String,Object> map = new HashMap<>();
		if(!StringTools.isEmpty(id)){
			map.put("id",Integer.parseInt(id));
		}
		map.put("state", state);
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("mobile", mobile);
		map.put("address", address);
		map.put("type", type);
		return withdrawDao.selectWithdrawList(map);
	}

	/**
	 * 修改审核状态
	 */
	@Override
	public int updateWithdrawStatus(Integer id, String state,String name) {
		Map<String,Object> map = new HashMap<>();
		map.put("id", id);
		map.put("state", state);
		map.put("name", name);
		return withdrawDao.updateWithdrawStatus(map);
	}

}
